﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Mock1G3.UserControl
{
    public partial class Rule : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }       
        protected void btnRule_Click(object sender, EventArgs e)
        {
            switch ((sender as Button).ID)
            {
                case "btnAccept":
                    foreach (Control item in this.Parent.Controls)
                    {
                        if (item.ID.Equals("ucReceiveAccount"))
                        {
                            item.Visible = true;
                            continue;
                        }
                        item.Visible = false;
                    }
                    break;
                case "btnReject":
                    Session.RemoveAll();
                    Response.Redirect("Default.aspx");
                    break;
            }            
        }
    }
}